<?php
namespace app\model;

use think\Model;

class MemberAutonym extends Model
{

	protected $connection = 'mysql';

	protected $pk = 'id';

	protected $name = 'member_autonym';

    public function member()
    {
        return $this->hasOne(Member::class, 'id', 'uid');
    }
    public function getUpdateTimeAttr($value,$data){
        if(isset($data['update_time'])){
            $value = date('Y-m-d H:i:s',$data['update_time']);
        }
        if(!isset($data['update_time']) && isset($data['caread_time'])){
            $value = date('Y-m-d H:i:s',$data['caread_time']);
        }
        return $value;
    }
}
